/*
ABOUT
===========================================================
version 1.7a
QT theme (stylesheet) specially developed for FreeCAD (http://www.freecadweb.org/).
It might work with other software that uses QT styling.


LICENSE
===========================================================
Copyright (c) 2015 Pablo Gil Fernández
The stylesheet barely uses code from Colin Duquesnoy "generic QT stylesheet"

This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.

 
CUSTOMIZATION
===========================================================
If you would like to change the overall look/style of the theme, just find and replace following colors in the whole file:
    background darker = #4f514d
    background dark and slighly darker = #5f615d
    background dark = #6f716d
    background normal and slighly darker = #7d7f79
    background normal = #888a85
    background light = #9c9e9a
    background lighter = #c8c9c7

    lists background = #d0d3cd
    lists background (alternate) = #cccfc9
    lists backgrounds selection = #c8cbc4

    foreground = white

    selection darker = #5d7619
    selection dark = #97c029
    selection normal = #b5d757
    selection inbetween normal and light = #c0dd70 (used to build SpinBoxes)
    selection light = #cbe389
    selection lighter = #dfefb4

 
*/

/* RESET EVERYTHING */
QAbstractScrollArea,QCheckBox,QColumnView,QComboBox,QDateEdit,QDateTimeEdit,QDialog,QDialogButtonBox,QDockWidget,QDoubleSpinBox,QFrame,QGroupBox,QHeaderView,QLabel,QLineEdit,QListView,QListWidget,QMainWindow,QMenu,QMenuBar,QMessageBox,QProgressBar,QPushButton,QRadioButton,QScrollBar,QSizeGrip,QSlider,QSpinBox,QSplitter,QStatusBar,QTabBar,QTabWidget,QTableView,QTableWidget,QTextEdit,QTimeEdit,QToolBar,QToolButton,QToolBox,QToolTip,QTreeView,QTreeWidget,QWidget {
    padding: 0px;
    margin: 0px;
    border: 0px;
    border-style: none;
    background-color: #888a85; /* set with default background color */
}

QMdiArea[showImage="true"] {
    background-image: url(icons/background_freecad.png);
    background-position: center;
    background-repeat: no-repeat;
}

QProgressBar,
QProgressBar:horizontal {
    background: #d0d3cd;
    border: 1px solid #6f716d;
    text-align: center;
    padding: 1px;
    border-radius: 4px;
}
QProgressBar::chunk,
QProgressBar::chunk:horizontal {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #97c029, stop:1 #b5d757);
    border-radius: 3px;
}

QToolTip {
    background-color: #4f514d;
    color: white;
    padding: 4px;
    border-radius: 4px;
}

QWidget {
    color: #4f514d;
    background-color: #888a85;
    background-clip: border;
    border-image: none;
    outline: 0;
}

QWidget:focus {
    border: 1px solid #4f514d;
}

QWidget:disabled {
    color: #9c9e9a;
    background-color: #4f514d; /* same as QMenu background-color */
}

QMenuBar {
    color: #c8c9c7;
    background-color: #7d7f79;
}

QMenuBar::item {
    background-color: #7d7f79;
}

QMenuBar::item:selected {
    color: #5d7619;
    border: 1px solid #b5d757;
    background-color: #b5d757;
}

QMenuBar::item:pressed {
    color: #5d7619;
    border: 1px solid #cbe389;
    background-color: #cbe389;
    margin-bottom:-1px;
    padding-bottom:1px;
}

QMenu {
    color: #c8c9c7;
    background-color: #4f514d;
    margin: 2px;
    border: 1px solid transparent;
}

QMenu::icon {
    margin: 5px;
    border-style: none;
}

QMenu::right-arrow {
    image:url(icons/right_arrow_light.png);
}

QMenu::item {
    color: #c8c9c7;
    background-color: #4f514d;
    padding: 2px 30px 2px 30px;
    border: 1px solid #4f514d; /* reserve space for selection border */
}

QMenu::item:selected {
    color: #5d7619;
    background-color: #cbe389;
}

QMenu::separator {
    height: 1px;
    background-color: #6f716d;
    margin-top: 2px;
    margin-bottom: 2px;
    margin-left: 6px;
    margin-right: 6px;
}

QMenu::indicator:non-exclusive {
    color: #c8c9c7;
    background-color: #9c9e9a;
    border: 1px solid #4f514d;
    width: 11px;
    height: 11px;
    border-radius:2px;
}

QMenu::indicator:non-exclusive:checked {
    background-color: #97c029;
    border: 1px solid #5d7619;
    image:url(icons/checkbox_light.png);
}

QGroupBox {
    color: #4f514d;
    font-weight: bold;
    border:1px solid blue;
    border-radius: 4px;
    margin-top: 20px;
    border-color: rgba(0, 0, 0, 20); /* lighter than "QGroupBox" border-color */
    background-color: rgba(255, 255, 255, 15);
}

QGroupBox::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
    background-color: transparent;
}

QAbstractScrollArea {
    border-radius: 2px;
    border: 1px solid #3A3939;
    background-color: transparent;
}

QAbstractScrollArea::corner {
    border: none;
    background-color: #888a85;
}

QScrollBar:horizontal {
    height: 15px;
    margin: 3px 15px 3px 15px;
    border: 1px transparent #4f514d;
    border-radius: 4px;
    background-color: #4f514d;
}

QScrollBar::handle:horizontal {
    background-color: #6f716d;
    min-width: 5px;
    border-radius: 4px;
}

QScrollBar::add-line:horizontal {
    margin: 1px 3px 0px 3px; /* 1px to correctly fit the 10px width image */
    border-image: url(icons/right_arrow_light.png);
    width: 6px;
    height: 10px;
    subcontrol-position: right;
    subcontrol-origin: margin;
}

QScrollBar::sub-line:horizontal {
    margin: 1px 3px 0px 3px; /* 1px to correctly fit the 10px width image */
    border-image: url(icons/left_arrow_light.png);
    height: 10px;
    width: 6px;
    subcontrol-position: left;
    subcontrol-origin: margin;
}

QScrollBar::add-line:horizontal:hover,
QScrollBar::add-line:horizontal:on {
    border-image: url(icons/right_arrow_lighter.png);
}


QScrollBar::sub-line:horizontal:hover,
QScrollBar::sub-line:horizontal:on {
    border-image: url(icons/left_arrow_lighter.png);
}

QScrollBar::up-arrow:horizontal,
QScrollBar::down-arrow:horizontal {
    background: none;
}


QScrollBar::add-page:horizontal,
QScrollBar::sub-page:horizontal {
    background: none;
}

QScrollBar:vertical {
    background-color: #4f514d;
    width: 15px;
    margin: 15px 3px 15px 3px;
    border: 1px transparent #4f514d;
    border-radius: 4px;
}

QScrollBar::handle:vertical {
    background-color: #6f716d;
    min-height: 5px;
    border-radius: 4px;
}

QScrollBar::sub-line:vertical {
    margin: 3px 0px 3px 1px; /* 1px to correctly fit the 10px width image */
    border-image: url(icons/up_arrow_light.png);
    height: 6px;
    width: 10px;
    subcontrol-position: top;
    subcontrol-origin: margin;
}

QScrollBar::add-line:vertical {
    margin: 3px 0px 3px 1px; /* 1px to correctly fit the 10px width image */
    border-image: url(icons/down_arrow_light.png);
    height: 6px;
    width: 10px;
    subcontrol-position: bottom;
    subcontrol-origin: margin;
}

QScrollBar::sub-line:vertical:hover,
QScrollBar::sub-line:vertical:on {
    border-image: url(icons/up_arrow_lighter.png);
}

QScrollBar::add-line:vertical:hover,
QScrollBar::add-line:vertical:on {
    border-image: url(icons/down_arrow_lighter.png);
}

QScrollBar::up-arrow:vertical,
QScrollBar::down-arrow:vertical {
    background: none;
}


QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical {
    background: none;
}

QTextEdit {
    color: #4f514d;
    background-color: #d0d3cd;
    border: 1px solid #6f716d;
    padding: 0px;
    margin: 0px;
}

QPlainTextEdit {
    color: #4f514d;
    background-color: #d0d3cd;
    border-radius: 2px;
    border: 1px solid #6f716d;
    padding: 0px;
    margin: 0px;
}

QSizeGrip {
    image: url(icons/sizegrip_light.png);
    width: 16px;
    height: 16px;
    background-color: transparent;
}

QRadioButton::indicator:unchecked{
    color: #4f514d;
    background-color: #9c9e9a;
    border: 1px solid #4f514d;
}

QRadioButton::indicator:checked {
    background-color: #97c029;
    border: 1px solid #5d7619;
    image:url(icons/radiobutton_light.png);
}

QCheckBox,
QRadioButton,
QCheckBox:disabled,
QRadioButton:disabled {
    color: #4f514d;
    padding: 3px;
    outline: none;
    background-color: transparent;
}

QCheckBox::indicator,
QGroupBox::indicator {
    color: #c8c9c7;
    background-color: #9c9e9a;
    border: 1px solid #4f514d;
}

QCheckBox::indicator {
    width: 11px;
    height: 11px;
    border-radius:2px;
}

QRadioButton::indicator {
    width: 11px;
    height: 11px;
    border-radius: 6px;
}

QRadioButton::indicator:pressed,
QCheckBox::indicator:pressed,
QCheckBox::indicator:non-exclusive:checked:pressed,
QCheckBox::indicator:indeterminate:pressed,
QCheckBox::indicator:checked:pressed {
    border-color: #dfefb4;
}

QCheckBox::indicator:checked,
QGroupBox::indicator:checked {
    background-color: #97c029;
    border: 1px solid #5d7619;
    image:url(icons/checkbox_light.png);
}

QCheckBox::indicator:disabled,
QRadioButton::indicator:disabled {
    border: 1px solid #6f716d;
}

QCheckBox:disabled,
QRadioButton::indicator:disabled {
    color: #6f716d;
    background-color: transparent;
}

QCheckBox::indicator:disabled,
QGroupBox::indicator:disabled,
QMenu::indicator:non-exclusive:disabled {
    background-color: #888a85;
}

QCheckBox::indicator:indeterminate {
    background-color: #97c029;
    border: 1px solid #5d7619;
    image: url(icons/checkbox_indeterminate_light.png);
}

QCheckBox:focus,
QRadioButton:focus {
    border: none;
}

QFrame,
QFrame:pressed,
QFrame:focus,
QFrame:on {
    border: 1px solid #888a85;
    border-radius: 3px;
    padding: 0px;
}

/* border and background of QComboBox drop-down */
QComboBox QFrame,
QComboBox QFrame:pressed,
QComboBox QFrame:focus,
QComboBox QFrame:on {
    border: 1px solid #4f514d;
    background-color: #4f514d;
    padding: 0px;
    margin: 0px;
}

QFrame[frameShape="0"] {
    border-radius: 3px;
}

QFrame[height="3"],
QFrame[width="3"] {
    border-color: transparent;
    background-color: transparent;
}

QFrame[height="3"] {
    border-top-color: #6f716d;
}

QFrame[width="3"] {
    border-left-color: #6f716d;
}

QPushButton {
    color: #c8c9c7;
    text-align: center;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #6f716d, stop:1 #888a85);
    border: 1px solid #4f514d;
    padding: 5px 12px 5px 12px;
    margin: 4px 8px 4px 8px;
    border-radius: 3px;
    min-width: 14px;
    min-height: 14px;
}

QPushButton:hover,
QPushButton:focus {
    color: white;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #97c029, stop:1 #b5d757);
    border-color: #97c029;
}

QPushButton:disabled,
QPushButton:disabled:checked {
    color: #6f716d;
    background-color: #888a85;
    border-color: #6f716d;
}

QPushButton:pressed {
    background-color: #97c029;
}

QPushButton:checked {
    background-color: #b5d757;
    border-color: #97c029;
}

/* Color Buttons */
Gui--ColorButton,
Gui--ColorButton:disabled {
    border-color: transparent;
    background-color: transparent;
    height: 24px;
    padding: 0px;
    margin: 0px;
}

Gui--ColorButton:hover {
    border-color: #7d7f79;
    background-color: #7d7f79;
}

/* Buttons inside the toolbar */
QToolBar QPushButton {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #7d7f79, stop:1 #888a85);
    border: 1px solid #6f716d;
    min-width: 22px;
    min-height: 22px;
    margin-left: 2px;
    margin-right: 2px;
    margin-bottom: 3px; /*bigger margin to correctly separate buttons inside a vertical toolbar */
    margin-top: 1px;
    padding: 1px;
}

QToolBar QPushButton:hover,
QToolBar QPushButton:focus {
    color: #c8c9c7;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #7d7f79, stop:1 #888a85);
    border: 1px solid #4f514d;
}

QToolBar QPushButton:disabled,
QToolBar QPushButton:disabled:checked {
    background-color: #888a85;
    border-color: #7d7f79;
}

QToolBar QPushButton:pressed {
    background-color: #6f716d;
    border-color: #6f716d;
}

QToolBar QPushButton:checked {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.8, x2:1, y2:0, stop:0 #b5d757, stop:1 #cbe389);
    border-color: #b5d757;
}

QToolBar QPushButton:checked:hover,
QToolBar QPushButton:checked:focus {
    color: #c8c9c7;
    border: 1px solid #97c029;
}

QToolBar {
    border: 1px transparent #393838;
    background-color: #888a85;
    font-weight: bold;
    margin: 0px;
    padding: 0px;
}

QToolBar::handle:horizontal {
    background-image: url(icons/Hmovetoolbar_dark.png);
    width: 10px;
    margin: 6px 2px 6px 2px;
    background-position: top right;
    background-repeat: repeat-y;
}

QToolBar::handle:vertical {
    background-image: url(icons/Vmovetoolbar_dark.png);
    height: 10px;
    margin: 2px 6px 2px 6px;
    background-position: left bottom;
    background-repeat: repeat-x;
}

QToolBar::separator:horizontal {
    background-image: url(icons/separtoolbar_dark.png);
    width: 10px;
    margin: 6px 2px 6px 2px;
    background-position: center center;
    background-repeat: repeat-y;
}

QToolBar::separator:vertical {
    background-image: url(icons/separtoolbar_dark.png);
    height: 10px;
    margin: 2px 6px 2px 6px;
    background-position: center center;
    background-repeat: repeat-x;
}

QStackedWidget {
    background-color: #888a85;
    border: 1px transparent #888a85;
}

QAbstractSpinBox {
    color: #c8c9c7;
    border: 1px solid #6f716d; /* border top color defined after QAbstractSpinBox, QLineEdit and QComboBox */
    background-color: #6f716d;
    selection-color: white;
    selection-background-color: #b5d757;
}

QAbstractSpinBox:disabled {
    color: #9c9e9a;
    background-color: #7d7f79;
    border-color: #7d7f79;
}

QAbstractSpinBox:up-button {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.8, x2:1, y2:0, stop:0 #c0dd70, stop:1 #cbe389);
    subcontrol-origin: border;
    subcontrol-position: top right;
    border-top-right-radius: 3px;
    height: 13px;
    width: 20px;
}

QAbstractSpinBox:down-button {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.8, x2:1, y2:0, stop:0 #b5d757, stop:1 #c0dd70);
    subcontrol-origin: border;
    subcontrol-position: bottom right;
    border-bottom-right-radius: 3px;
    height: 13px;
    width: 20px;
}

QAbstractSpinBox:up-button:disabled,
QAbstractSpinBox:down-button:disabled {
    background-color: transparent;
}

QAbstractSpinBox::up-arrow {
    image: url(icons/up_arrow_light.png);
    top: 0px; /* fix simetry between up and down images */
}

QAbstractSpinBox::up-arrow:hover {
    image: url(icons/up_arrow_lighter.png);
}

QAbstractSpinBox::up-arrow:off {
    image: url(icons/up_arrow_disabled_dark.png);
}

QAbstractSpinBox::up-arrow:disabled {
    image: none;
}

QAbstractSpinBox::down-arrow {
    image: url(icons/down_arrow_light.png);
    bottom: -2px; /* fix simetry between up and down images */
}
QAbstractSpinBox::down-arrow:hover {
    image: url(icons/down_arrow_lighter.png);
}

QAbstractSpinBox::down-arrow:off {
    image: url(icons/down_arrow_disabled_dark.png);
}

QAbstractSpinBox::down-arrow:disabled {
    image: none;
}

QToolBar QAbstractSpinBox {
    margin-top: 0px;
    margin-bottom: 0px;
}

QLineEdit {
    color: #c8c9c7;
    background-color: #6f716d;
    selection-color: white;
    selection-background-color: #b5d757;
    /* Padding and margin defined */
    border-style: solid;
    border: 1px solid #6f716d; /* border top color defined after QAbstractSpinBox, QLineEdit and QComboBox */
    border-radius: 3px;
}

QAbstractSpinBox:focus,
QLineEdit:focus,
QComboBox:focus {
    border-color: #cbe389;
}

QComboBox {
    color: #c8c9c7;
    background-color: #6f716d;
    selection-color: white;
    selection-background-color: #b5d757;
    border: 1px solid #6f716d; /* border top color defined after QAbstractSpinBox, QLineEdit and QComboBox */
    border-radius: 3px;
}

QComboBox:on {
    color: white;
    background-color: #6f716d;
    border-color: #cbe389;
}

QComboBox::drop-down {
    subcontrol-origin: margin;
    subcontrol-position: top right;
    width: 20px;
    border-left-width: 1px;
    border-left-color: transparent;
    border-left-style: solid;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.8, x2:1, y2:0, stop:0 #b5d757, stop:1 #cbe389);
}

QComboBox::down-arrow {
    image: url(icons/down_arrow_light.png);
}

QComboBox::down-arrow:on,
QComboBox::down-arrow:hover,
QComboBox::down-arrow:focus {
    image: url(icons/down_arrow_lighter.png);
}

QComboBox QAbstractItemView {
    color: #c8c9c7;
    background-color: #4f514d;
    border-radius: 3px;
    margin: 0px;
    padding: 0px;
    border: none;
}

/* Common parameters for QAbstractSpinBox, QLineEdit and QComboBox */
QSpinBox,
QDoubleSpinBox,
QAbstractSpinBox,
QLineEdit,
QComboBox {
    border-top-color: #5f615d; /* Creates an inset effect inside the elements */
    padding: 2px 6px 2px 6px; /* This makes text colour work on QComboBox */
    margin: 0px 2px 0px 2px;
    min-width: 70px; /* it was 120 because of QCombobox... */
    border-radius: 3px;
}
/* end Common parameters */

QAbstractItemView {
    color: #4f514d;
    alternate-background-color: #cccfc9; /* related with QListView background  */
    border: 1px solid #4f514d;
    border-radius: 3px;
    padding: 0px;
}

/* hack to deactivate changing background color when focus (due to QFrame generic transparent color) */
QAbstractItemView:selected,
QAbstractItemView:on,
QAbstractItemView:focus {
    background-color: #d0d3cd; /* same as QTable background color */
}

/* hack to hide weird redundant information inside the value of a Placement cell */
QTreeView QLabel,
QTreeView QLabel:disabled {
    color: transparent;
    background-color: transparent;
    border: none;
    border-radius: 0px;
    margin: 0px;
    padding: 0px;
}

QTreeView QLineEdit {
    color: #c8c9c7;
    border-color: #6f716d;
    background-color: #6f716d;
    selection-color: white;
    selection-background-color: #b5d757;
}

/* hack to hide non editable cells inside Property values */
QTreeView QLineEdit:read-only,
QTreeView QLineEdit:disabled,
QTreeView QAbstractSpinBox:read-only,
QTreeView QAbstractSpinBox:disabled {
    color: transparent;
    border-color: transparent;
    background-color: transparent;
    selection-color: transparent;
    selection-background-color: transparent;
}

/* hack to disable margin inside Property values to following elements */
QTreeView QSpinBox,
QTreeView QDoubleSpinBox,
QTreeView QAbstractSpinBox,
QTreeView QLineEdit,
QTreeView QComboBox {
    margin-left: 0px;
    margin-right: 0px;
}

/* Pushbutton style for "..." inside Placement cell which launches Placement tool */
QTreeView QPushButton {
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #6f716d, stop:1 #888a85);
    border-top: none;
    border-bottom: none;
    border-right: none;
    border-left: 1px solid #6f716d;
    border-radius: 0px;
    margin: 0px;
    padding: 0px;
    height: 24px;
}

/* Color Buttons inside the "Properties window" */
QAbstractItemView Gui--ColorButton {
    padding: 0px;
    margin: 0px;
    height: 10px;
}

QAbstractItemView QPushButton:hover {
    color: white;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #97c029, stop:1 #b5d757);
    border-color: #97c029;
}

QAbstractItemView QPushButton:disabled {
    color: transparent;
    background-color: transparent;
    border-color: transparent;
}

QLabel {
    border: 0px solid #4f514d;
}

QTabWidget{
    border: none;
}

QTabWidget:focus {
    border: none;
}

QTabWidget::pane {
    border: none;
    padding: 0px;
    background-color: #888a85;
    position: absolute;
    top: -15px;
    padding-top: 15px;
}

QTabWidget::tab-bar {
    alignment: center;
}

QTabBar {
    qproperty-drawBase: 0;
    left: 5px;
    background-color: transparent;
}

QTabBar:focus {
    border: 0px transparent black;
}

QTabBar::close-button {
    padding: 0px;
    margin: 0px;
    border-radius: 2px;
    background-image: url(icons/close_dark.png);
    background-position: center center;
    background-repeat: none;
}

QTabBar::close-button:hover {
    background-color: #cbe389;
}

QTabBar::close-button:pressed {
    background-color: #dfefb4;
}

QTabBar::scroller { /* the width of the scroll buttons */
    width: 20px;
}

/* the scroll buttons are tool buttons */
QTabBar QToolButton,
QTabBar QToolButton:hover { 
    margin-top: 4px;
    margin-bottom: 4px;
    margin-left: 0px;
    margin-right: 0px;
    padding: 0px;
    border: none;
    background-color: #888a85;
    border-radius: 0px;
}

QTabBar QToolButton::right-arrow:enabled {
     image: url(icons/right_arrow_light.png);
}

QTabBar QToolButton::right-arrow:disabled,
QTabBar QToolButton::right-arrow:off {
     image: url(icons/right_arrow_disabled_dark.png);
}

QTabBar QToolButton::right-arrow:hover {
     image: url(icons/right_arrow_lighter.png);
}

 QTabBar QToolButton::left-arrow:enabled {
     image: url(icons/left_arrow_light.png);
}

 QTabBar QToolButton::left-arrow:disabled,
 QTabBar QToolButton::left-arrow:off {
     image: url(icons/left_arrow_disabled_dark.png);
}

 QTabBar QToolButton::left-arrow:hover {
     image: url(icons/left_arrow_lighter.png);
}

 QTabBar QToolButton::up-arrow:enabled {
     image: url(icons/up_arrow_light.png);
}

 QTabBar QToolButton::up-arrow:disabled,
 QTabBar QToolButton::up-arrow:off {
     image: url(icons/up_arrow_disabled_dark.png);
}

 QTabBar QToolButton::up-arrow:hover {
     image: url(icons/up_arrow_lighter.png);
}

 QTabBar QToolButton::down-arrow:enabled {
     image: url(icons/down_arrow_light.png);
}

 QTabBar QToolButton::down-arrow:disabled,
 QTabBar QToolButton::down-arrow:off {
     image: url(icons/down_arrow_disabled_dark.png);
}

 QTabBar QToolButton::down-arrow:hover {
     image: url(icons/down_arrow_lighter.png);
}

/* TOP and BOTTOM TABS */
QTabBar::tab:top,
QTabBar::tab:bottom {
    color: #c8c9c7;
    border: 1px solid #6f716d;
    border-left-color: #888a85;
    border-right-width: 0px;
    background-color: #6f716d;
    padding:5px 15px;
    margin-top: 4px;
    margin-bottom: 4px;
    position: center;
}

QTabBar::tab:top:first,
QTabBar::tab:bottom:first {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

QTabBar::tab:top:last,
QTabBar::tab:bottom:last {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-right-width: 1px;
}

QTabBar::tab:top:selected,
QTabBar::tab:bottom:selected {
    color: white;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #97c029, stop:1 #b5d757);
    border-color: #97c029;
}

QTabBar::tab:top:!selected:hover,
QTabBar::tab:bottom:!selected:hover {
    color: white;
}

QTabBar::tab:top:only-one ,
QTabBar::tab:bottom:only-one {
    border: 1px solid #5d7619;
    border-radius: 6px;
}

/* LEFT and RIGHT TABS */
QTabBar::tab:left,
QTabBar::tab:right {
    color: #c8c9c7;
    border: 1px solid #6f716d;
    border-top-color: #888a85;
    border-bottom-width: 0px;
    background-color: #6f716d;
    padding: 15px 5px;
    margin-left: 4px;
    margin-right: 4px;
    position: center;
}

QTabBar::tab:left:first,
QTabBar::tab:right:first {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

QTabBar::tab:left:last,
QTabBar::tab:right:last {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    border-bottom-width: 1px;
}

QTabBar::tab:left:selected,
QTabBar::tab:right:selected {
    color: white;
    background-color: qlineargradient(spread:pad, x1:0.545, y1:1, x2:0, y2:1, stop:0 #97c029, stop:1 #b5d757);
    border-color: #97c029;
}

QTabBar::tab:left:!selected:hover,
QTabBar::tab:right:!selected:hover {
    color: white;
}

QTabBar::tab:left:only-one ,
QTabBar::tab:right:only-one {
    border: 1px solid #5d7619;
    border-radius: 6px;
}

QDockWidget {
    color: #4f514d;
    border: 1px solid #888a85;
    titlebar-close-icon: url(icons/close_dark.png);
    titlebar-normal-icon: url(icons/undock_dark.png);
}

QDockWidget::title {
    text-align: center;
    background-color: #7d7f79;
    padding: 4px;
    border-radius: 4px;
}

QDockWidget::close-button,
QDockWidget::float-button {
    border: 1px transparent #888a85;
    border-radius: 2px;
    background: transparent;
    subcontrol-origin: padding;
    subcontrol-position: right center;
}

QDockWidget::close-button {
    right: 4px;
}
    
QDockWidget::float-button {
    right: 22px;
}

QDockWidget::close-button:hover,
QDockWidget::float-button:hover {
    background: #9c9e9a;
}

QDockWidget::close-button:pressed,
QDockWidget::float-button:pressed {
    /*padding: 1px -1px -1px 1px;*/
    background-color: #7d7f79;
}

QTreeView,
QListView {
    color: #4f514d;
    border: 1px solid #888a85;
    border-radius: 4px;
    background-color: #d0d3cd;  /* related with alternate-background-color*/
    selection-color: white;
    selection-background-color: #b5d757; /* should be similar to QListView::item selected background-color */
    show-decoration-selected: 1; /* make the selection span the entire width of the view */
    padding: 0px;
    margin: 0px 4px 0px 4px;
    min-width: 130px; /* hack to correctly align Preferences icon list  */
}

QListView,
QListView::item,
QListView QAbstractItemView {
    margin: 0px;
    icon-size: 20px; /* temporal */
    paint-alternating-row-colors-for-empty-area: 1;
    position: absolute;
    subcontrol-origin: margin;
    subcontrol-position: left top;
}

/* Control dropdown list margins of QComboBox */
QComboBox QTreeView,
QComboBox QListView {
    margin: 0px;
    padding: 0px;
}

QListView::item {
    border: 0px transparent #888a85;
    border-radius: 4px;
    background-color: transparent;
    padding: 0px;
    margin: 0px;
    display: inline-block;
    position: relative;
}

QListView::item:selected,
QTreeView::item:selected  {
    color: white;
    background-color: #b5d757; /* should be similar to QListView selection-background-color */
}

/* Branch system */
QTreeView::branch  {
    background: transparent;
}

QTreeView::branch:has-siblings:!adjoins-item  {
    border-image: url(icons/branch_vline.png) 0;
}

QTreeView::branch:has-siblings:adjoins-item  {
    border-image: url(icons/branch_more.png) 0;
}

QTreeView::branch:!has-children:!has-siblings:adjoins-item  {
    border-image: url(icons/branch_end.png) 0;
}

QTreeView::branch:closed:has-children:has-siblings  {
    image: url(icons/branch_closed_dark.png);
}

QTreeView::branch:has-children:!has-siblings:closed  {
    image: url(icons/branch_closed_dark.png);
    border-image: url(icons/branch_end.png) 0;
}

QTreeView::branch:open:has-children:has-siblings  {
    image: url(icons/branch_open_dark.png);
    border-image: url(icons/branch_more.png) 0;
}

QTreeView::branch:open:has-children:!has-siblings  {
    image: url(icons/branch_open_dark.png);
    border-image: url(icons/branch_end.png) 0;
}

QSlider,
QSlider:active,
QSlider:!active {
    border: none;
    background-color: transparent;
}

QSlider:horizontal {
    padding: 0px 10px;
}

QSlider:vertical {
    padding: 10px 0px;
}

QSlider::groove:horizontal {
    border: 1px solid #6f716d;
    background-color: #6f716d;
    height: 8px;
    border-radius: 5px;
    margin: 4px 0;
}

QSlider::groove:vertical {
    border: 1px solid #6f716d;
    background-color: #6f716d;
    width: 8px;
    border-radius: 5px;
    margin: 4px 0;
}

QSlider::groove:horizontal:disabled,
QSlider::groove:vertical:disabled {
    border-color:  #7d7f79;
    background-color: #7d7f79;
}

QSlider::handle:horizontal,
QSlider::handle:vertical {
    background-color: #4f514d;
    border: 1px solid #4f514d;
    width: 14px;
    height: 14px;
    border-radius: 8px;
}

QSlider::handle:horizontal {
    margin: -4px 0;
}

QSlider::handle:vertical {
    margin: 0 -4px;
}

QSlider::handle:horizontal:hover,
QSlider::handle:vertical:hover {
    border-color: #97c029;
    background-color: #97c029;
}

QSlider::handle:horizontal:pressed,
QSlider::handle:vertical:pressed {
    border-color: #5d7619;
    background-color: #5d7619;
}

QSlider::handle:horizontal:disabled,
QSlider::handle:vertical:disabled {
    border-color: #6f716d;
    background-color: #888a85;
}

QToolButton {
    color: #c8c9c7;
    text-align: center;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #6f716d, stop:1 #888a85);
    border: 1px solid #4f514d;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 15px;
    padding-right: 15px;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 10px;
    margin-right: 10px;
    border-radius: 3px;
    outline: none;
}

QToolButton:hover,
QToolButton:focus {
    color: white;
    background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #97c029, stop:1 #b5d757);
    border-color: #97c029;
}

QToolButton:disabled,
QToolButton:disabled:checked {
    color: #6f716d;
    background-color: #888a85;
    border-color: #6f716d;
}

QToolButton:pressed {
    border-color: #cbe389;
}

QToolButton:checked {
    background-color: #b5d757;
    border-color: #97c029;
}

QToolButton::menu-indicator  {
    subcontrol-origin: padding;
    subcontrol-position: center right;
    right: 4px;
}

/*The "show more" button  (it can also be stylable with "QToolBarExtension" */
QToolButton#qt_toolbar_ext_button {
    border-radius: 0px;
    margin: 0px;
    padding: 0px;
    /*background-image: url(icons/more_dark.png);*/
    image: transparent;
    background-repeat: none;
    background-position: center left;
}

QToolButton#qt_toolbar_ext_button:hover {
    /*background-image: url(icons/more_light.png);*/
    border-color: #7d7f79;
    background-color: #7d7f79;
}

QToolButton#qt_toolbar_ext_button:on {
    /*background-image: url(icons/more_light.png);*/
    border-color: #7d7f79;
    background-color: #7d7f79;
}

/*Buttons inside the Toolbar*/
QToolBar QToolButton {
    color: #4f514d;
    background-color: #888a85;
    border: 1px transparent #888a85;
    border-radius: 3px;
    margin: 0px;
    padding: 2px;
}

QToolBar QToolButton:disabled {
    background-color: #888a85;
}

QToolBar QToolButton:checked {
    color: #5d7619;
    background-color: #b5d757;
    border: 1px solid #b5d757;
}

QToolBar QToolButton:hover {
    background-color: #888a85;
}

QToolBar QToolButton:pressed,
QToolBar QToolButton::menu-button:pressed {
    background-color: #7d7f79;
    border: 1px solid #7d7f79;
}


QToolBar QToolButton::menu-indicator:hover,
QToolBar QToolButton::menu-indicator:pressed {
    background-color: transparent;
}

/* the subcontrols below are used only in the MenuButtonPopup mode */
QToolBar QToolButton::menu-button {
    border: 1px transparent #4A4949;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    width: 16px; /* 16px width + 4px for border = 20px allocated above */
    outline: none;
    background-color: transparent;
}

QToolBar QToolButton::menu-button:hover,
QToolBar QToolButton::menu-button:active,
QToolBar QToolButton::menu-button:disabled {
    border-color: transparent;
    }